home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
nn.zip
/
PATCH09
< prev
next >
Wrap
Text File
|
1989-12-31
|
51KB
|
2,041 lines
Subject: nn patch 9
Date: 3 Nov 89 09:11:32 MET (Fri)
From: storm@texas.dk (Kim F. Storm)
This is patch #9 to nn.
It fixes a number of bugs and add a feature or two.
NOTICE
------
This patch changes the name of the variable 'patch-cmd' to
'patch-command'.
BUGS FIXED
----------
When using CBREAK or no flow-control, the help screens and nnadmin no
longer messes up the screen (the missing CR is now printed by nn).
When displaying the data in a group with nnadmin G D, the output is
now "paged" (although it could be better).
Unique temporary files are now created as needed. Before you could
risk loosing a newly posted article if posting twice in a row.
Long subjects in split folders no longer messes up the menu.
The customized article header is now redrawn after help and with ^L.
Folders containing headers from :unshar'ed and :decode'd articles can
now be saved in proper mmdf format (before the first ^A^A^A^A line was
missing).
nn will now save the proper part of the header when :unshar'ing or
:decode'ing from a folder or a digest (before it saved too much).
The :set command will now show integer variables whose value is zero.
Killing the last article on a menu while reading it will no longer give
a core dump.
Killing the first article on a menu while reading it will no longer
cause the rest of the articles to be skipped.
A portability problem in the makefile was fixed (but there are still
problems if the pre-processor converts leading tabs to spaces).
The aux script has been fixed to drop messages which are not edited by
the user, i.e. no empty or "included material only" messages can be
sent out. (It is still possible to forward an article using the mail
command).
NEW FEATURES
------------
The following command is now available in reading mode:
TAB {skip-lines}
Skip lines whose first character is the same as the first
character on the last displayed line. This is typically used
to skip over included text.
When nnadmin is invoked from nn via :admin, the Group: prompts can now
be answered with an empty line which will select group that was active
when :admin was called.
There is a new
on term <value of $TERM>
...
end
form that can be included in the init files. It can be used to
adjust nn's behaviour to different kinds of terminals, e.g. on some
terminals the down arrow sends a ^J which may prevent correct
interpretation of the return key when CBREAK is used. On other
terminals, the left arrow key sends a backspace which may prevent the
erase from working. Assuming TERM=xyzzy is a terminal with both these
problems, include this in the global (!) init file:
on term xyzzy
map key down ^J
set erase-key left
end
There is a new variable 'confirm-entry' that will cause nn to ask
whether a group should be entered before drawing the article menu.
This can be used in slow mode to limit the output:
on slow
set confirm-entry
end
When it is set, then when nn enters a group with unread articles, it
will first ask:
Enter?
Answer (y) to enter the group or (n) to skip to the next group without
updating the current group. Hitting (interrupt) will cause nn to ask:
Mark as read?
Answer (y) to mark the group as read and continue with the next group,
or (n) to skip to the next group without updating the current group.
Hitting (interrupt) again will cause nn to quit immediately.
There is a new variable unshar-command to control the program invoked
to unpack shell archives with the :unshar command.
There is a new variable shell-restrictions that can be set in the init
file to prevent the user from escaping out of nn by the normal means
like ! and ^Z, and also prevent changing variables like unshar-command
and printer. This may be useful for public demonstration purposes.
--------------------------- cut here -----------------------------
*** /usr/storm/nn6.3.8/patchlevel.h Fri Sep 15 19:06:23 1989
--- patchlevel.h Fri Oct 20 23:01:29 1989
***************
*** 28,34 ****
* hope).
*
* 1989-09-15: Patch 8: pack_name.c nntp.c
*/
! #define PATCHLEVEL 8
--- 28,35 ----
* hope).
*
* 1989-09-15: Patch 8: pack_name.c nntp.c
+ * 1989-10-20: Patch 9: several files
*/
! #define PATCHLEVEL 9
*** /usr/storm/nn6.3.7/admin.c Fri Sep 8 12:46:40 1989
--- admin.c Wed Oct 18 21:44:57 1989
***************
*** 28,39 ****
if ((c = *pre_input++) == NUL)
nn_exit(0);
} else {
! if (prompt1) printf("%s\n", prompt1);
! if (prompt2) printf("%s >>>", prompt2);
fl;
raw();
c = get_c();
! no_raw();
if (c == K_interrupt)
s_keyboard++;
else
--- 28,39 ----
if ((c = *pre_input++) == NUL)
nn_exit(0);
} else {
! if (prompt1) printf("\r%s\n", prompt1);
! if (prompt2) printf("\r%s >>>", prompt2);
fl;
raw();
c = get_c();
! unset_raw();
if (c == K_interrupt)
s_keyboard++;
else
***************
*** 81,90 ****
--- 81,114 ----
return get_cmd((char *)NULL, buffer) == 'Y';
}
+ char *get_groupname()
+ {
+ char * groupname;
+
+ raw();
+ printf("Group: ");
+ fl;
+ groupname = get_s(NONE, NONE, NONE, group_completion);
+ unset_raw();
+
+ putchar(NL); putchar(CR);
+
+ if (groupname == NULL) return NULL;
+
+ if (groupname[0]) return groupname;
+ if (current_group == NULL) return NULL;
+ if (current_group->group_flag & G_FOLDER) return NULL;
+
+ return current_group->group_name;
+ }
+
+
admin_mode(input_string)
char *input_string;
{
+ int was_raw = unset_raw();
+
if (input_string && *input_string) {
pre_input = input_string;
} else {
***************
*** 149,154 ****
--- 173,179 ----
break;
case 'Q':
+ if (was_raw) raw();
return;
}
}
***************
*** 278,297 ****
if (c == 'G') {
char *groupname;
! raw();
! printf("Group: ");
! fl;
! groupname = get_s(NONE, NONE, NONE, group_completion);
! no_raw();
!
! putchar(NL); putchar(CR);
!
! if (groupname == NULL) return;
!
sprintf(command, "grep '%s' %s/Log | %s",
groupname, lib_directory, pager);
system(command);
!
goto loop;
}
--- 303,313 ----
if (c == 'G') {
char *groupname;
! groupname = get_groupname();
sprintf(command, "grep '%s' %s/Log | %s",
groupname, lib_directory, pager);
system(command);
!
goto loop;
}
***************
*** 311,317 ****
sprintf(command, "grep '^%c:' %s/Log | %s", c, lib_directory, pager);
system(command);
!
goto loop;
}
--- 327,333 ----
sprintf(command, "grep '^%c:' %s/Log | %s", c, lib_directory, pager);
system(command);
!
goto loop;
}
***************
*** 322,344 ****
register group_header *gh;
new_group:
!
! raw();
! printf("Group: ");
! fl;
! groupname = get_s(NONE, NONE, NONE, group_completion);
! no_raw();
!
! putchar(NL); putchar(CR);
- if (groupname == NULL) return;
-
gh = lookup(groupname);
if (gh == NULL) {
printf("No group named %s\n", groupname);
goto new_group;
}
!
for (;;) {
switch (get_cmd(
"\nC)lear_flag D)ata E)xpire F)iles G)roup H)eader S)et_flag R)ecollect",
--- 338,351 ----
register group_header *gh;
new_group:
! groupname = get_groupname();
gh = lookup(groupname);
if (gh == NULL) {
printf("No group named %s\n", groupname);
goto new_group;
}
!
for (;;) {
switch (get_cmd(
"\nC)lear_flag D)ata E)xpire F)iles G)roup H)eader S)et_flag R)ecollect",
***************
*** 497,503 ****
static show_config()
{
- extern char *temp_file;
extern char news_active[], news_directory[];
#ifdef NNTP
extern char nntp_server[];
--- 504,509 ----
***************
*** 636,641 ****
--- 642,652 ----
next_article = first_article;
s_keyboard = 0;
was_digest = 0;
+
+ if (!validate) {
+ clrdisp();
+ pg_init(1, 1);
+ }
while (next_article <= gh->last_l_article) {
if (s_hangup || s_keyboard) goto out;
***************
*** 652,658 ****
fseek(data, data_offset, 0);
in_digest:
!
next_offset = data_offset;
if (!db_read_art(data, &hdr, &data_offset)) {
if (real_offset == gh->data_write_offset || was_digest)
--- 663,673 ----
fseek(data, data_offset, 0);
in_digest:
! if (!validate && pg_scroll(6)) {
! s_keyboard = 1;
! goto out;
! }
!
next_offset = data_offset;
if (!db_read_art(data, &hdr, &data_offset)) {
if (real_offset == gh->data_write_offset || was_digest)
*** /usr/storm/nn6.3.7/answer.c Fri Sep 8 12:46:40 1989
--- answer.c Thu Oct 19 14:44:26 1989
***************
*** 10,15 ****
--- 10,17 ----
export char *extra_news_headers = NULL;
export char *mail_record = NULL;
export char *news_record = NULL;
+ export char *mail_script = NULL;
+ export char *news_script = NULL;
export int nn_re_style = 0; /* use Re^n: in replies */
export int include_art_id = 0;
***************
*** 30,36 ****
register FILE *t, *art;
char *pgm, *first_action, *record_file;
int edit_message;
! char *str;
news_header_buffer nhbuf, dhbuf;
first_action = "edit";
--- 32,38 ----
register FILE *t, *art;
char *pgm, *first_action, *record_file;
int edit_message;
! char *str, *script;
news_header_buffer nhbuf, dhbuf;
first_action = "edit";
***************
*** 66,71 ****
--- 68,74 ----
ah = NULL;
/* build header */
+ new_temp_file();
if ((t = open_file(temp_file, OPEN_CREATE)) == NULL) {
msg("Can't create %s", temp_file);
***************
*** 73,80 ****
}
ed_line = 0;
record_file = mail_record;
!
if (command == K_REPLY) {
pgm = "reply";
ah->flag |= A_ST_REPLY;
--- 76,87 ----
}
ed_line = 0;
+
+ follow_to_poster:
+
record_file = mail_record;
! script = mail_script;
!
if (command == K_REPLY) {
pgm = "reply";
ah->flag |= A_ST_REPLY;
***************
*** 100,106 ****
else
subj_line(t, 0, current_group->group_name, "Your Article in");
! ng_line(t);
ref_line(t);
end_header(t, extra_mail_headers);
--- 107,113 ----
else
subj_line(t, 0, current_group->group_name, "Your Article in");
! ng_line(t, 0);
ref_line(t);
end_header(t, extra_mail_headers);
***************
*** 112,122 ****
}
if (command == K_FOLLOW_UP) {
pgm = "follow";
record_file = news_record;
ah->flag |= A_ST_FOLLOW;
! ng_line(t);
if (news.ng_subj)
subj_line(t, ah->replies, ah->subject, (char *)NULL);
--- 119,136 ----
}
if (command == K_FOLLOW_UP) {
+ if (news.ng_follow && strcmp(news.ng_follow, "poster") == 0) {
+ command = K_REPLY;
+ msg("Followup by reply to poster");
+ goto follow_to_poster;
+ }
+
pgm = "follow";
record_file = news_record;
+ script = news_script;
ah->flag |= A_ST_FOLLOW;
! ng_line(t, 1);
if (news.ng_subj)
subj_line(t, ah->replies, ah->subject, (char *)NULL);
***************
*** 232,238 ****
fclose(t);
if (art) fclose(art);
! aux_sh(pgm, first_action, record_file,
command == K_FOLLOW_UP ? "Article not posted" : "Mail not sent");
return edit_message;
--- 246,252 ----
fclose(t);
if (art) fclose(art);
! aux_sh(script, pgm, first_action, record_file,
command == K_FOLLOW_UP ? "Article not posted" : "Mail not sent");
return edit_message;
***************
*** 284,290 ****
ed_line = -1;
! if (aux_sh("cancel",
news.ng_ident, current_group->group_name, "Not canceled"))
return -1;
--- 298,304 ----
ed_line = -1;
! if (aux_sh((char *)NULL, "cancel",
news.ng_ident, current_group->group_name, "Not canceled"))
return -1;
***************
*** 346,351 ****
--- 360,366 ----
if (str == NULL) return 0;
if (*str) strcpy(distribution, str);
+ new_temp_file();
if ((t = open_file(temp_file, OPEN_CREATE)) == NULL) {
msg("Can't create %s", temp_file);
return 0;
***************
*** 367,373 ****
fclose(t);
! aux_sh("post", "edit", news_record, "Article not posted");
return 1;
}
--- 382,388 ----
fclose(t);
! aux_sh(news_script, "post", "edit", news_record, "Article not posted");
return 1;
}
***************
*** 399,409 ****
}
! static ng_line(t)
FILE *t;
{
fprintf(t, "Newsgroups: %s\n",
! news.ng_follow ? news.ng_follow : news.ng_groups);
ed_line++;
}
--- 414,425 ----
}
! static ng_line(t, use_follow)
FILE *t;
+ int use_follow;
{
fprintf(t, "Newsgroups: %s\n",
! use_follow && news.ng_follow ? news.ng_follow : news.ng_groups);
ed_line++;
}
***************
*** 485,492 ****
* WARNING: record may be NULL, soit must be the last argument!!
*/
! static aux_sh(prog, action, record, not_sent)
! char *prog, *action, *record, *not_sent;
{
char *args[8];
char number[10];
--- 501,508 ----
* WARNING: record may be NULL, soit must be the last argument!!
*/
! static aux_sh(script, prog, action, record, not_sent)
! char *script, *prog, *action, *record, *not_sent;
{
char *args[8];
char number[10];
***************
*** 494,500 ****
time_t start_t;
*ap++ = "nnaux";
! *ap++ = relative(lib_directory, "aux");
*ap++ = prog;
if (ed_line >= 0) { /* not cancel */
--- 510,516 ----
time_t start_t;
*ap++ = "nnaux";
! *ap++ = script != NULL ? script : relative(lib_directory, "aux");
*ap++ = prog;
if (ed_line >= 0) { /* not cancel */
*** /usr/storm/nn6.3.7/aux.sh Fri Sep 8 12:46:41 1989
--- aux.sh Fri Oct 20 19:32:49 1989
***************
*** 89,94 ****
--- 89,106 ----
$EDITOR $WORK
;;
esac
+ if [ -n "$COPY" ] ; then
+ if [ -s $WORK ] ; then
+ if cmp -s $WORK $COPY ; then
+ rm -f $WORK $COPY
+ exit 22
+ fi
+ else
+ rm -f $WORK $COPY
+ exit 22
+ fi
+ rm -f $COPY
+ fi
;;
o*|s*)
***************
*** 106,121 ****
done
if [ -n "$COPY" ] ; then
- if [ -s $WORK ] ; then
- if cmp -s $WORK $COPY ; then
- rm -f $WORK $COPY
- exit 22
- fi
- else
- rm -f $WORK $COPY
- exit 22
- fi
-
rm -f $COPY
fi
--- 118,123 ----
*** /usr/storm/nn6.3.7/execute.c Fri Sep 8 12:46:42 1989
--- execute.c Fri Oct 20 21:55:06 1989
***************
*** 3,10 ****
--- 3,22 ----
#include "config.h"
#include "term.h"
+ export int shell_restrictions = 0; /* disable shell escapes */
+
char *user_shell;
+ static shell_check()
+ {
+ if (shell_restrictions) {
+ msg("Restricted operation - not allowed");
+ return -1;
+ }
+ return 0;
+ }
+
+
init_execute()
{
if ((user_shell = getenv("SHELL")) == NULL)
***************
*** 56,61 ****
--- 68,75 ----
char *cmd;
int first = 1;
+ if (shell_check()) return 0;
+
prompt("!");
again:
***************
*** 92,97 ****
--- 106,113 ----
{
char cmdstring[512];
+ if (shell_check()) return 0;
+
if (!expand_file_name(cmdstring, command))
return 0;
***************
*** 121,126 ****
--- 137,144 ----
{
int was_raw;
+ if (shell_check()) return 0;
+
was_raw = unset_raw();
gotoxy(0, Lines-1);
clrline();
*** /usr/storm/nn6.3.7/folder.c Fri Sep 8 12:46:42 1989
--- folder.c Wed Oct 18 18:06:22 1989
***************
*** 441,457 ****
length = pack_name(buffer, digest.dg_from, NAME_LENGTH);
ap->sender = alloc_str(length);
strcpy(ap->sender, buffer);
! } else
ap->sender = "";
!
if (digest.dg_subj) {
length = pack_subject(buffer, digest.dg_subj, &re, 255);
ap->replies = re;
ap->subject = alloc_str(length);
strcpy(ap->subject, buffer);
} else {
ap->replies = 0;
ap->subject = "";
}
add_article(ap);
--- 441,462 ----
length = pack_name(buffer, digest.dg_from, NAME_LENGTH);
ap->sender = alloc_str(length);
strcpy(ap->sender, buffer);
! ap->name_length = length;
! } else {
ap->sender = "";
! ap->name_length = 0;
! }
!
if (digest.dg_subj) {
length = pack_subject(buffer, digest.dg_subj, &re, 255);
ap->replies = re;
ap->subject = alloc_str(length);
strcpy(ap->subject, buffer);
+ ap->subj_length = length;
} else {
ap->replies = 0;
ap->subject = "";
+ ap->subj_length = 0;
}
add_article(ap);
*** /usr/storm/nn6.3.7/global.c Fri Sep 8 12:46:42 1989
--- global.c Wed Oct 18 18:00:30 1989
***************
*** 146,155 ****
mkdir(nn_directory, 0755); /* should check here */
}
- if ((env = getenv("TMPDIR")) == NULL) env = TMP_DIRECTORY;
- temp_file = mk_file_name(env, "nn.XXXXXX"); /* dies in ANSI C! */
- mktemp(temp_file);
return 0;
}
/*
--- 146,165 ----
mkdir(nn_directory, 0755); /* should check here */
}
return 0;
+ }
+
+ new_temp_file()
+ {
+ static char buf[FILENAME];
+ static char *temp_dir = NULL;
+
+ if (temp_dir == NULL && (temp_dir = getenv("TMPDIR")) == NULL)
+ temp_dir = TMP_DIRECTORY;
+
+ sprintf(buf, "%s/nn.XXXXXX", temp_dir);
+ mktemp(buf);
+ temp_file = buf;
}
/*
*** /usr/storm/nn6.3.7/init.c Fri Sep 8 12:46:44 1989
--- init.c Wed Oct 18 21:30:21 1989
***************
*** 935,940 ****
--- 935,947 ----
if (terminal_speed <= (slow_speed / 10)) goto skip_to_end;
break;
}
+
+ CASE( "term" ) {
+ extern char *term_name;
+
+ if (argv(2) == NULL || strcmp(argv(2), term_name)) goto skip_to_end;
+ break;
+ }
goto on_err;
}
*** /usr/storm/nn6.3.7/keymap.c Fri Sep 8 12:46:45 1989
--- keymap.c Wed Oct 18 21:23:45 1989
***************
*** 65,71 ****
/* ACK ^F */ K_UNBOUND,
/* BEL ^G */ K_INVALID,
/* BS ^H */ K_PREV_PAGE,
! /* TAB ^I */ K_UNBOUND,
/* NL ^J */ K_NEXT_LINE,
/* VT ^K */ K_UNBOUND,
/* FF ^L */ K_REDRAW,
--- 65,71 ----
/* ACK ^F */ K_UNBOUND,
/* BEL ^G */ K_INVALID,
/* BS ^H */ K_PREV_PAGE,
! /* TAB ^I */ K_SKIP_LINES,
/* NL ^J */ K_NEXT_LINE,
/* VT ^K */ K_UNBOUND,
/* FF ^L */ K_REDRAW,
***************
*** 485,490 ****
--- 485,491 ----
"select-range", K_SELECT_RANGE, K_ONLY_MENU,
"select-subject", K_SELECT_SUBJECT, 0,
"shell", K_SHELL, 0,
+ "skip-lines", K_SKIP_LINES, 0,
"unselect-all", K_UNSELECT_ALL, K_ONLY_MENU,
"unshar", K_UNSHAR, 0,
*** /usr/storm/nn6.3.7/keymap.h Fri Sep 8 12:46:45 1989
--- keymap.h Wed Oct 18 20:36:56 1989
***************
*** 43,48 ****
--- 43,49 ----
/* scrolling/menu movement */
+ #define K_SKIP_LINES 0x0023 /* skip lines of same type */
#define K_NEXT_PAGE 0x0024 /* next page */
#define K_NEXT_HALF_PAGE 0x0025 /* next half page */
#define K_NEXT_LINE 0x0026 /* next line */
*** /usr/storm/nn6.3.7/kill.c Fri Sep 8 12:46:45 1989
--- kill.c Wed Oct 18 18:00:29 1989
***************
*** 495,500 ****
--- 495,501 ----
compf = open_file(relative(nn_directory, COMPILED_KILL), OPEN_CREATE);
if (compf == NULL) goto err1;
+ new_temp_file();
if ((patternf = open_file(temp_file, OPEN_CREATE)) == NULL)
goto err2;
*** /usr/storm/nn6.3.7/menu.c Fri Sep 8 12:46:47 1989
--- menu.c Fri Oct 20 18:13:23 1989
***************
*** 19,24 ****
--- 19,25 ----
export int slow_mode = 0; /* mark selected articles with *s */
export int re_layout = 0; /* Re: format presentation on menus */
export int collapse_subject = 25; /* collapse long subjects at position */
+ export int conf_group_entry = 0; /* ask whether group should be entered */
export char *delayed_msg = NULL; /* give to msg() after redraw */
export long dl_msg_arg = 0; /* optional arg to delayed_msg */
***************
*** 346,351 ****
--- 347,353 ----
extern int enable_stop, file_completion();
extern int alt_cmd_key, in_menu_mode, any_message;
article_number elim_list[3];
+ int entry_check = conf_group_entry;
#define menu_return(cmd) \
{ menu_cmd = (cmd); goto menu_exit; }
***************
*** 433,438 ****
--- 435,457 ----
REDRAW_CHECK;
+ if (entry_check && menu_level == 1 &&
+ (current_group->group_flag & G_READ) == 0) {
+ entry_check = 0;
+ prompt_line = firstl;
+ prompt("\1Enter?\1 ");
+ if ((temp = yes(0)) == 0) menu_return(ME_NEXT);
+ if (temp < 0) {
+ prompt("\1Mark as read?\1 ");
+ if ((temp = yes(0)) > 0) menu_return(ME_READ);
+ if (temp < 0) menu_return(ME_QUIT);
+ menu_return(ME_NEXT);
+ }
+
+ gotoxy(0, firstl);
+ clrline();
+ }
+
how = INIT;
mark(); /* fl; */
***************
*** 1133,1139 ****
static show_articles()
{
! register article_number cur, next;
register article_header *ah;
article_number elim_list[1];
register int mode;
--- 1152,1158 ----
static show_articles()
{
! register article_number cur, next, temp;
register article_header *ah;
article_number elim_list[1];
register int mode;
***************
*** 1170,1185 ****
elim_list[0] = next;
elim_articles(elim_list, 1);
cur = elim_list[0];
! if (cur <= 0) cur = n_articles;
continue;
}
break;
case MC_DO_SELECT:
! for (next = cur+1, cur = -1; next < n_articles; next++) {
! if (auto_select_article(ah = articles[next], 2))
ah->flag |= A_SELECT;
! if (cur < 0 && ah->flag & A_SELECT) cur = next;
}
continue;
--- 1189,1205 ----
elim_list[0] = next;
elim_articles(elim_list, 1);
cur = elim_list[0];
! if (cur < 0) cur = n_articles;
continue;
}
break;
case MC_DO_SELECT:
! for (temp = cur+1, cur = next; temp < n_articles; temp++) {
! if (auto_select_article(ah = articles[temp], 2)) {
ah->flag |= A_SELECT;
! if (temp < cur) cur = temp;
! }
}
continue;
*** /usr/storm/nn6.3.7/mk_online_man Fri Sep 8 12:46:48 1989
--- mk_online_man Thu Oct 19 17:25:03 1989
***************
*** 3,15 ****
sed -e 's/\\f[BPI]//g' \
-e 's/\\-/-/g' \
-e 's/\\&//' \
! -e '/^\.\\"/d' \
-e '/^\.nf/d' \
-e '/^\.fi/d' \
-e '/^\.if/d' \
- -e '/^\.DT/d' \
-e '/^\.ta/d' \
-e '/^\.nr/d' \
-e 's/^\.[BI] //' "$@" |
awk '
BEGIN {
--- 3,15 ----
sed -e 's/\\f[BPI]//g' \
-e 's/\\-/-/g' \
-e 's/\\&//' \
! -e '/^\.\\" /d' \
-e '/^\.nf/d' \
-e '/^\.fi/d' \
-e '/^\.if/d' \
-e '/^\.ta/d' \
-e '/^\.nr/d' \
+ -e '/^\.in/d' \
-e 's/^\.[BI] //' "$@" |
awk '
BEGIN {
***************
*** 18,23 ****
--- 18,25 ----
m=72
a=0
h=""
+ t=0
+ tab=sprintf("%c",9)
}
/^\.SH / {
if (a) printf("%s\n\n", l)
***************
*** 72,77 ****
--- 74,107 ----
} else while (length(l) < 4) l=l " "
next
}
+ /^\.\\"ta/ {
+ for (t=2; t <= NF; t++) to[t-1] = $t
+ t=NF
+ next
+ }
+ /^\.DT/ {
+ t=0
+ next
+ }
+ t != 0 {
+ j=length($0)
+ k=0; g=1
+ for (i=1; i<=j; i++) {
+ while (k < to[g]) {
+ printf(" ")
+ k++
+ }
+ c=substr($0,i,1)
+ if (c == tab) {
+ g++
+ } else {
+ printf("%s", c)
+ k++
+ }
+ }
+ printf("\n")
+ next
+ }
{
s=1
p=" "
*** /usr/storm/nn6.3.7/more.c Fri Sep 8 12:46:48 1989
--- more.c Wed Oct 18 20:47:31 1989
***************
*** 112,118 ****
int form_feed, last_ff_line, ignore_nl;
off_t firstl, lastl;
off_t linepos[LINEMAX];
! char linebuf[200], *lp;
int linenum, maxline, topline, print_lines, lno1;
int underline_line, fake_underline;
int match_lines, match_redraw, match_topline, match_botline;
--- 112,122 ----
int form_feed, last_ff_line, ignore_nl;
off_t firstl, lastl;
off_t linepos[LINEMAX];
! char linebuf[200], *lp, skip_char;
! int skip_wrap;
! #ifndef LIMITED_STACK
! news_header_buffer ngheader, dgheader;
! #endif
int linenum, maxline, topline, print_lines, lno1;
int underline_line, fake_underline;
int match_lines, match_redraw, match_topline, match_botline;
***************
*** 149,155 ****
--- 153,163 ----
/* temporary use of linepos array as header buffers... */
+ #ifdef LIMITED_STACK
art = open_news_article(ah, open_modes, (char *)&linepos[100], (char *)&linepos[LINEMAX/2]);
+ #else
+ art = open_news_article(ah, open_modes, ngheader, dgheader);
+ #endif
if (art == NULL) {
msg("Expired: \"%s: %-.50s\"", ah->sender, ah->subject);
***************
*** 193,198 ****
--- 201,207 ----
rot13 = 0;
compress_space = compress_mode;
last_ff_line = goto_line = -1, prev_goto = 1;
+ skip_char = NUL; skip_wrap = 0;
match_lines = match_redraw = match_expr = 0;
underline_line = -1;
fake_underline = 0;
***************
*** 227,232 ****
--- 236,246 ----
} else
clrdisp();
+ #ifndef LIMITED_STACK
+ if (linenum == 1)
+ hdrline = screen_offset == 0 ? header_lines : "";
+ #endif
+
print_header:
if (hdrline == NULL || *hdrline == '*') {
if (hdrline && *++hdrline == NUL) hdrline = NULL;
***************
*** 471,477 ****
case '\f':
last_ff_line = linenum;
if (lp == linebuf) {
! if (goto_line > 0 || match_expr || lno == lno1) goto next_line;
form_feed = 1;
goto Prompt;
}
--- 485,492 ----
case '\f':
last_ff_line = linenum;
if (lp == linebuf) {
! if (goto_line > 0 || skip_char || match_expr || lno == lno1)
! goto next_line;
form_feed = 1;
goto Prompt;
}
***************
*** 536,543 ****
end_line:
/* if we are seaching for a specific line, repeat until it is found */
if (goto_line >= linenum) goto next_line;
!
*lp++ = NUL;
if (match_expr) {
--- 551,569 ----
end_line:
/* if we are seaching for a specific line, repeat until it is found */
+ if (skip_wrap) {
+ skip_wrap = ignore_nl;
+ goto next_line;
+ }
if (goto_line >= linenum) goto next_line;
! if (skip_char) {
! if (lp == linebuf || linebuf[0] == skip_char) {
! skip_wrap = ignore_nl;
! goto next_line;
! }
! skip_char = NUL;
! }
!
*lp++ = NUL;
if (match_expr) {
***************
*** 638,643 ****
--- 664,671 ----
match_redraw = 0;
Prompt:
+
+ if (eof && lno == screen_offset) more_return(MC_NEXT);
raw();
***************
*** 890,895 ****
--- 918,927 ----
linenum = topline - window_lines + overlap; /* not perfect after FF */
underline_line = topline;
if (linenum < 1) linenum = 1;
+ goto next_page;
+
+ case K_SKIP_LINES:
+ skip_char = linebuf[0];
goto next_page;
case K_GOTO_LINE:
*** /usr/storm/nn6.3.7/news.c Fri Sep 8 12:46:48 1989
--- news.c Wed Oct 18 19:37:08 1989
***************
*** 151,157 ****
while (*bp && *bp != ':' && isascii(*bp) && !isspace(*bp))
bp++;
bp++;
! while (*bp && isascii(*bp) && isspace(*bp)) bp++;
*fptr = bp;
}
while (*bp && *bp != NL) bp++;
--- 151,157 ----
while (*bp && *bp != ':' && isascii(*bp) && !isspace(*bp))
bp++;
bp++;
! while (*bp && isascii(*bp) && isspace(*bp) && *bp != NL) bp++;
*fptr = bp;
}
while (*bp && *bp != NL) bp++;
*** /usr/storm/nn6.3.7/nn.1 Fri Sep 8 12:46:50 1989
--- nn.1 Fri Oct 20 23:22:52 1989
***************
*** 520,525 ****
--- 520,530 ----
.I one\ line\ forward
in the article.
.TP
+ \&\fBtab\fP {\fBskip-lines\fP}
+ Skip over lines starting with the same character as the last line on
+ the current page. This is useful to skip over included text or to the
+ next file in a shell archive.
+ .TP
\&\fB^\fP {\fBpage=1\fP}
Goto the first page (excluding the header) of the article.
.TP
***************
*** 789,795 ****
.TP
\&\fB:patch\fP {\fBpatch\fP}
Send articles through \fBpatch\fP(1) (or the program defined in the
! \fBpatch-cmd\fP variable). Instead of a file name, you will be
prompted for the name of a directory in which you want the patch
command to be executed. \fInn\fP will then pipe the body of the
article through the patch command.
--- 794,800 ----
.TP
\&\fB:patch\fP {\fBpatch\fP}
Send articles through \fBpatch\fP(1) (or the program defined in the
! \fBpatch-command\fP variable). Instead of a file name, you will be
prompted for the name of a directory in which you want the patch
command to be executed. \fInn\fP will then pipe the body of the
article through the patch command.
***************
*** 1771,1776 ****
--- 1776,1793 ----
the `N' {\fBnext-group\fP} command. But it will not look for new
articles arrived since the invokation of \fInn\fP.
.TP
+ \fBconfirm-entry\fP (boolean, default false)
+ When set, \fInn\fP will ask for confirmation before entering a group
+ with unread articles. It is useful on slow terminals if you don't
+ want to wait until \fInn\fP has drawn the first menu to be able to
+ skip the group.
+ Answering no to the "Enter?" prompt will cause \fInn\fP to skip to
+ the next group without marking the current group as read. If you
+ answer by hitting \fBinterrupt\fP, \fInn\fP will ask the question
+ "Mark as read?" which allows you to mark the current group as read
+ before going to the next group. If this second question is also
+ answered by hitting \fBinterrupt\fP, \fInn\fP will quit immediately.
+ .TP
\fBconfirm-messages\fP (boolean, default false)
In some cases, \fInn\fP will sleep one second (or more) when it has shown a
message to the user, e.g. in connection with macro debugging. Setting
***************
*** 1925,1930 ****
--- 1942,1952 ----
format, i.e. you can use you favourite mailer (and \fInn\fP) to look at
the file.
.TP
+ \fBmail-script\fP \fIfile\fP (string, default not set)
+ When set, \fInn\fP will use the specified file instead of the standard
+ \fIaux\fP script when executing the \fBreply\fP and \fBmail\fP
+ commands.
+ .TP
\fBmark-overlap\fP (boolean, default false)
When set, \fInn\fP will draw a line (using the underline capabilities
of the terminal if possible) to indicate the end of the overlap (see the
***************
*** 1954,1959 ****
--- 1976,1986 ----
Save file for follow-ups and postings. Same rules and format as the
\fBmail-record\fP variable.
.TP
+ \fBnews-script\fP \fIfile\fP (string, default not set)
+ When set, \fInn\fP will use the specified file instead of the standard
+ \fIaux\fP script when executing the \fBfollow\fP and \fBpost\fP
+ commands.
+ .TP
\fBnewsrc\fP (boolean, default false)
When set, \fInn\fP will synchronize its own
.I rc
***************
*** 1987,1993 ****
is piped through as well as most of the output from
.IR nnadmin (1M).
.TP
! \fBpatch-cmd\fP \fIshell-command\fP (string, default "patch")
This is the command which is invoked by the \fBpatch\fP command.
.TP
\fBprinter\fP \fIshell-command\fP (string, default is system dep.)
--- 2014,2020 ----
is piped through as well as most of the output from
.IR nnadmin (1M).
.TP
! \fBpatch-command\fP \fIshell-command\fP (string, default "patch")
This is the command which is invoked by the \fBpatch\fP command.
.TP
\fBprinter\fP \fIshell-command\fP (string, default is system dep.)
***************
*** 2045,2050 ****
--- 2072,2082 ----
.B S*
command).
.TP
+ \fBshell-restrictions\fP (boolean, default false)
+ When set (in the init file), \fInn\fP will not allow the user to
+ invoke the shell in any way, including saving on pipes. It also
+ prevents the user from changing certain variables containig commands.
+ .TP
\fBsilent\fP (boolean, default false)
When set, \fInn\fP wont print the logo or "No News" if there are no
unread articles. Only useful to set in the init file or with the
***************
*** 2099,2104 ****
--- 2131,2139 ----
.I sysline (1)
utility.
.TP
+ \fBunshar-command\fP \fIshell-command\fP (string, default "/bin/sh")
+ This is the command which is invoked by the \fBunshar\fP command.
+ .TP
\fBunshar-header-file\fP \fIfile\fP (string, default "Unshar.Headers")
The name of the file in which the header and initial text of articles
unpacked with the \fB:unshar\fP command is saved. Unless the file name
***************
*** 2155,2160 ****
--- 2190,2196 ----
.LP
.in +8n
.ta 5m
+ .\"ta 4 9
.br
\fBA\fP Approved:
.br
***************
*** 2477,2483 ****
in one of the modes, that mode will contain the word \fBnix\fP.
.LP
.in +8n
! .ta \w'select-subject'u+5m +\w'Selection mode'u+3m
.br
\fIFunction Selection mode Reading mode
.br
--- 2513,2520 ----
in one of the modes, that mode will contain the word \fBnix\fP.
.LP
.in +8n
! .ta \w'select-subject'u+5m +\w'Selection_mode'u+3m
! .\"ta 4 20 36
.br
\fIFunction Selection mode Reading mode
.br
***************
*** 2593,2598 ****
--- 2630,2637 ----
.br
\fBshell\fP ! !
.br
+ \fBskip-lines\fP \fBnix\fP \fBtab\fP
+ .br
\fBunselect-all\fP ~ \fBnix\fP
.br
\fBunshar\fP
***************
*** 2896,2901 ****
--- 2935,2941 ----
.sp 0.5v
.nf
\fBon slow\fP
+ set confirm-entry
set slow-mode
set delay-redraw
unset visible-bell
***************
*** 2911,2916 ****
--- 2951,2961 ----
Same as \fBon slow\fP except that the commands are only executed when
the terminal is running at a speed above the \fBslow-speed\fP value.
.TP
+ \fBon term\fP \fIterm-type\fP
+ .br
+ The commands are executed if the TERM environment variable contains
+ the value specified by \fIterm-type\fP.
+ .TP
\fBon entry\fP
.br
These commands (macro format!) are executed every time \fInn\fP enters a
***************
*** 3206,3214 ****
.SH FILES
.DT
.nr tW \w'~/.nn/KILL.COMP'
! .nr tX \w'/usr/lib/terminfo/*'
.if \n(tWu>\n(tXu .nr tX \n(tWu
.ta \n(tWu+3m
~/.nn/rc The record of read articles.
.br
~/.nn/rc.bak Copy of rc file saved on entry to \fInn\fP.
--- 3251,3260 ----
.SH FILES
.DT
.nr tW \w'~/.nn/KILL.COMP'
! .nr tX \w'/usr/lib/nntp-server'
.if \n(tWu>\n(tXu .nr tX \n(tWu
.ta \n(tWu+3m
+ .\"ta 0 22
~/.nn/rc The record of read articles.
.br
~/.nn/rc.bak Copy of rc file saved on entry to \fInn\fP.
*** /usr/storm/nn6.3.8/pack_name.c Tue Oct 10 12:26:59 1989
--- pack_name.c Thu Oct 19 09:17:13 1989
***************
*** 447,452 ****
--- 447,456 ----
for (p = name+1; p < q; p++) {
if (*p == TAB) continue;
if (*p == ' ') continue;
+ if (*p == '-' && (p + 1) < q) {
+ p++;
+ continue;
+ }
*p = TAB;
lname--;
}
*** /usr/storm/nn6.3.7/pack_subject.c Fri Sep 8 12:46:52 1989
--- pack_subject.c Wed Oct 18 17:25:12 1989
***************
*** 13,21 ****
register char *max_dest;
re = 0;
if (src) {
- start_dest = dest;
max_dest = dest + max_length;
while (*src) {
--- 13,21 ----
register char *max_dest;
re = 0;
+ start_dest = dest;
if (src) {
max_dest = dest + max_length;
while (*src) {
*** /usr/storm/nn6.3.7/save.c Fri Sep 8 12:46:59 1989
--- save.c Fri Oct 20 22:42:01 1989
***************
*** 22,32 ****
export char *save_counter_format = "%d"; /* format of save counter */
export char printer[FILENAME] = PRINTER; /* lp -s -ol */
! export char *patch_cmd = "patch";
extern int file_completion();
import char *temp_file;
static int save_mode;
static char *unshar_cmd;
--- 22,34 ----
export char *save_counter_format = "%d"; /* format of save counter */
export char printer[FILENAME] = PRINTER; /* lp -s -ol */
! export char *patch_command = "patch";
! export char *unshar_command = SHELL;
extern int file_completion();
import char *temp_file;
+ import int shell_restrictions;
static int save_mode;
static char *unshar_cmd;
***************
*** 122,127 ****
--- 124,133 ----
}
if (*save_name == '|') {
+ if (shell_restrictions) {
+ msg("Restricted operation - pipes not allowed");
+ return NULL;
+ }
mode_text = "Pipe";
save_name++;
save_mode |= IS_PIPE;
***************
*** 155,167 ****
case K_PATCH:
save_mode = NO_HEADER | SEPARATE_FILES | DO_UNSHAR | DO_PATCH;
mode_text = "Patch";
! unshar_cmd = patch_cmd;
goto patch1;
case K_UNSHAR:
save_mode = NO_HEADER | SEPARATE_FILES | DO_UNSHAR;
mode_text = "Unshar";
! unshar_cmd = SHELL;
patch1:
prompt("\1%s Directory:\1 ", mode_text);
--- 161,173 ----
case K_PATCH:
save_mode = NO_HEADER | SEPARATE_FILES | DO_UNSHAR | DO_PATCH;
mode_text = "Patch";
! unshar_cmd = patch_command;
goto patch1;
case K_UNSHAR:
save_mode = NO_HEADER | SEPARATE_FILES | DO_UNSHAR;
mode_text = "Unshar";
! unshar_cmd = unshar_command;
patch1:
prompt("\1%s Directory:\1 ", mode_text);
***************
*** 174,184 ****
save_mode = SHORT_HEADER | IS_PIPE;
! prompt("\1Print command:\1 ");
! save_name = get_s(NONE, printer, NONE, NO_COMPLETION);
! if (save_name == NULL || *save_name == NUL) return NULL;
!
! strcpy(printer, save_name);
mode_text = "Print";
break;
--- 180,193 ----
save_mode = SHORT_HEADER | IS_PIPE;
! if (shell_restrictions) {
! save_name = printer;
! } else {
! prompt("\1Print command:\1 ");
! save_name = get_s(NONE, printer, NONE, NO_COMPLETION);
! if (save_name == NULL || *save_name == NUL) return NULL;
! strcpy(printer, save_name);
! }
mode_text = "Print";
break;
***************
*** 347,352 ****
--- 356,362 ----
else
sprintf(copybuf, "%s %s", unshar_cmd, pager_redir);
#else
+ new_temp_file();
sprintf(copybuf,
"cd %s && { %s 2>&1 ; } | tee %s ; cat %s >> %s.Result ; rm %s",
save_name != NULL ? save_name : ".", unshar_cmd,
***************
*** 515,522 ****
}
fseek(h, (off_t)0, 2);
if (!use_mmdf_folders && ftell(h) > 0) putc(NL, h); /* just in case */
! mailbox_format(f, 1);
! endpos = ftell(f);
fseek(f, ah->hpos, 0);
while (--endpos >= 0 && (c = getc(f)) != EOF)
putc(c, h);
--- 525,532 ----
}
fseek(h, (off_t)0, 2);
if (!use_mmdf_folders && ftell(h) > 0) putc(NL, h); /* just in case */
! mailbox_format(h, 1);
! endpos = ftell(f) - ah->hpos;
fseek(f, ah->hpos, 0);
while (--endpos >= 0 && (c = getc(f)) != EOF)
putc(c, h);
*** /usr/storm/nn6.3.7/term.c Fri Sep 8 12:46:59 1989
--- term.c Wed Oct 18 21:53:21 1989
***************
*** 1142,1148 ****
if (!is_raw) {
raw();
c = get_c();
! no_raw();
} else
c = get_c();
--- 1142,1148 ----
if (!is_raw) {
raw();
c = get_c();
! unset_raw();
} else
c = get_c();
***************
*** 1189,1195 ****
{
FILE *f;
register c, stand_on;
! int was_raw, linecnt, headln_cnt, hdline, no_conf;
char headline[128];
headline[0] = 0;
--- 1189,1195 ----
{
FILE *f;
register c, stand_on;
! int linecnt, headln_cnt, hdline, no_conf;
char headline[128];
headline[0] = 0;
***************
*** 1198,1207 ****
headln_cnt = -1;
- was_raw = is_raw;
-
- no_raw();
-
if (modes & CLEAR_DISPLAY) {
gotoxy(0,0);
clrdisp();
--- 1198,1203 ----
***************
*** 1251,1256 ****
--- 1247,1253 ----
if (hdline) {
puts(headline);
+ putchar(CR);
hdline = 0;
linecnt--;
}
***************
*** 1257,1262 ****
--- 1254,1260 ----
putchar(c);
if (c == NL) {
+ putchar(CR);
if (headln_cnt >= 0) {
headline[--headln_cnt] = 0;
headln_cnt = -1;
***************
*** 1279,1286 ****
fclose(f);
}
- if (was_raw) raw();
-
prompt_line = Lines-1; /* move prompt to last line */
if (!no_conf && (modes & CONFIRMATION))
--- 1277,1282 ----
***************
*** 1295,1301 ****
char *fmt;
va_list ap;
! no_raw();
clrdisp();
fl;
--- 1291,1297 ----
char *fmt;
va_list ap;
! unset_raw();
clrdisp();
fl;
***************
*** 1396,1402 ****
if (fmt != P_REDRAW && fmt != P_RESTORE)
vsprintf(cur_p, fmt, va_args2toN);
! putchar('\r');
for (cp = cur_p, stand_on = 0, prompt_length = 0; *cp; cp++) {
if (*cp == '\1') {
--- 1392,1398 ----
if (fmt != P_REDRAW && fmt != P_RESTORE)
vsprintf(cur_p, fmt, va_args2toN);
! putchar(CR);
for (cp = cur_p, stand_on = 0, prompt_length = 0; *cp; cp++) {
if (*cp == '\1') {
***************
*** 1478,1484 ****
c = get_c();
do_macro_processing = dmp;
! if (!was_raw) no_raw();
return c;
}
--- 1474,1480 ----
c = get_c();
do_macro_processing = dmp;
! if (!was_raw) unset_raw();
return c;
}
***************
*** 1494,1499 ****
--- 1490,1506 ----
pg_quit = pg_col = 0;
pg_width = Columns / cols;
pg_maxw = pg_width * (cols - 1);
+ }
+
+ pg_scroll(n)
+ int n;
+ {
+ pg_line += n;
+ if (pg_line >= (Lines - 1)) {
+ pg_line = 0;
+ return any_key(0) == K_interrupt;
+ }
+ return 0;
}
pg_next()
*** /usr/storm/nn6.3.7/variable.c Fri Sep 8 12:47:00 1989
--- variable.c Fri Oct 20 22:55:08 1989
***************
*** 17,27 ****
included_mark[],
*mail_box,
*mail_record,
*news_record,
*pager,
! *patch_cmd,
printer[],
*save_counter_format,
*unshar_header_file;
import int /* boolean variables */
--- 17,30 ----
included_mark[],
*mail_box,
*mail_record,
+ *mail_script,
*news_record,
+ *news_script,
*pager,
! *patch_command,
printer[],
*save_counter_format,
+ *unshar_command,
*unshar_header_file;
import int /* boolean variables */
***************
*** 31,36 ****
--- 34,40 ----
conf_append,
conf_auto_quit,
conf_dont_sleep,
+ conf_group_entry,
delay_redraw,
do_kill_handling,
dont_sort_articles,
***************
*** 49,54 ****
--- 53,59 ----
quick_save,
save_report,
seq_cross_filtering,
+ shell_restrictions,
show_article_date,
show_current_time,
silent,
***************
*** 89,94 ****
--- 94,102 ----
#define V_KEY 3
#define V_SPECIAL 4
+ #define V_SAFE 0x80
+ #define V_INIT 0x40
+
struct variable_defs {
char *var_name;
char var_type;
***************
*** 95,102 ****
char var_op;
char **var_addr;
} variables[] = {
! "also-subgroups", V_BOOLEAN, 3, (char **)&also_subgroups,
! "backup", V_BOOLEAN, 3, (char **)&keep_rc_backup,
"collapse-subject", V_INTEGER, 3, (char **)&collapse_subject,
"columns", V_INTEGER, 1, (char **)&Columns,
"comp1_key", V_KEY, 0, (char **)&comp1_key,
--- 103,110 ----
char var_op;
char **var_addr;
} variables[] = {
! "also-subgroups", V_BOOLEAN | V_INIT, 0, (char **)&also_subgroups,
! "backup", V_BOOLEAN | V_INIT, 0, (char **)&keep_rc_backup,
"collapse-subject", V_INTEGER, 3, (char **)&collapse_subject,
"columns", V_INTEGER, 1, (char **)&Columns,
"comp1_key", V_KEY, 0, (char **)&comp1_key,
***************
*** 104,109 ****
--- 112,118 ----
"compress", V_BOOLEAN, 0, (char **)&compress_mode,
"confirm-append", V_BOOLEAN, 0, (char **)&conf_append,
"confirm-auto-quit",V_BOOLEAN, 0, (char **)&conf_auto_quit,
+ "confirm-entry", V_BOOLEAN, 0, (char **)&conf_group_entry,
"confirm-messages", V_BOOLEAN, 0, (char **)&conf_dont_sleep,
"cross-filter-seq", V_BOOLEAN, 0, (char **)&seq_cross_filtering,
"cross-post", V_BOOLEAN, 0, (char **)&also_cross_postings,
***************
*** 133,138 ****
--- 142,148 ----
"mail-format", V_BOOLEAN, 0, (char **)&use_mail_folders,
"mail-header", V_STRING, 0, (char **)&extra_mail_headers,
"mail-record", V_STRING, 2, (char **)&mail_record,
+ "mail-script", V_STRING | V_SAFE, 2, (char **)&mail_script,
"mark-overlap", V_BOOLEAN, 0, (char **)&mark_overlap,
"min-window", V_INTEGER, 1, (char **)&min_pv_window,
"mmdf-format", V_BOOLEAN, 0, (char **)&use_mmdf_folders,
***************
*** 139,151 ****
"monitor", V_BOOLEAN, 0, (char **)&monitor_mode,
"news-header", V_STRING, 0, (char **)&extra_news_headers,
"news-record", V_STRING, 2, (char **)&news_record,
"newsrc", V_BOOLEAN, 0, (char **)&use_newsrc,
"nn-re-style", V_BOOLEAN, 0, (char **)&nn_re_style,
"old", V_SPECIAL, 2, (char **)NULL,
"overlap", V_INTEGER, 0, (char **)&overlap,
! "pager", V_STRING, 3, (char **)&pager,
! "patch-cmd", V_STRING, 3, (char **)&patch_cmd,
! "printer", V_STRING, 1, (char **)printer,
"quick-save", V_BOOLEAN, 0, (char **)&quick_save,
"re-layout", V_INTEGER, 0, (char **)&re_layout,
"record", V_SPECIAL, 1, (char **)NULL,
--- 149,162 ----
"monitor", V_BOOLEAN, 0, (char **)&monitor_mode,
"news-header", V_STRING, 0, (char **)&extra_news_headers,
"news-record", V_STRING, 2, (char **)&news_record,
+ "news-script", V_STRING | V_SAFE, 2, (char **)&news_script,
"newsrc", V_BOOLEAN, 0, (char **)&use_newsrc,
"nn-re-style", V_BOOLEAN, 0, (char **)&nn_re_style,
"old", V_SPECIAL, 2, (char **)NULL,
"overlap", V_INTEGER, 0, (char **)&overlap,
! "pager", V_STRING | V_SAFE, 3, (char **)&pager,
! "patch-command", V_STRING | V_SAFE, 3, (char **)&patch_command,
! "printer", V_STRING | V_SAFE, 1, (char **)printer,
"quick-save", V_BOOLEAN, 0, (char **)&quick_save,
"re-layout", V_INTEGER, 0, (char **)&re_layout,
"record", V_SPECIAL, 1, (char **)NULL,
***************
*** 153,158 ****
--- 164,170 ----
"retry-on-error", V_INTEGER, 0, (char **)&retry_on_error,
"save-counter", V_STRING, 3, (char **)&save_counter_format,
"save-report", V_BOOLEAN, 0, (char **)&save_report,
+ "shell-restrictions", V_BOOLEAN|V_INIT, 0, (char **)&shell_restrictions,
"silent", V_BOOLEAN, 0, (char **)&silent,
"slow-mode", V_BOOLEAN, 0, (char **)&slow_mode,
"slow-speed", V_INTEGER, 0, (char **)&slow_speed,
***************
*** 160,165 ****
--- 172,178 ----
"split", V_BOOLEAN, 4, (char **)&dont_split_digests,
"stop", V_INTEGER, 0, (char **)&first_page_lines,
"time", V_BOOLEAN, 0, (char **)&show_current_time,
+ "unshar-command", V_STRING | V_SAFE, 3, (char **)&unshar_command,
"unshar-header-file",V_STRING, 0, (char **)&unshar_header_file,
"visible-bell", V_BOOLEAN, 0, (char **)&use_visible_bell,
"window", V_INTEGER, 1, (char **)&preview_window,
***************
*** 174,180 ****
#define STR_VAR (*(var->var_addr))
#define CBUF_VAR ((char *)(var->var_addr))
#define KEY_VAR (*((unsigned char *)(var->var_addr)))
!
static struct variable_defs *lookup_variable(variable)
char *variable;
--- 187,193 ----
#define STR_VAR (*(var->var_addr))
#define CBUF_VAR ((char *)(var->var_addr))
#define KEY_VAR (*((unsigned char *)(var->var_addr)))
! #define VAR_TYPE (var->var_type & 0xf)
static struct variable_defs *lookup_variable(variable)
char *variable;
***************
*** 218,229 ****
if ((var = lookup_variable(variable)) == NULL)
return 0;
if (!on || val_string == NULL)
value = 0;
else
value = atoi(val_string);
! switch (var->var_type) {
case V_STRING:
--- 231,253 ----
if ((var = lookup_variable(variable)) == NULL)
return 0;
+ if (!in_init && (var->var_type & (V_INIT | V_SAFE))) {
+ if (var->var_type & V_INIT) {
+ msg("'%s' can only be set in the init file", variable);
+ return 0;
+ }
+ if (shell_restrictions) {
+ msg("Restricted operation - cannot change");
+ return 0;
+ }
+ }
+
if (!on || val_string == NULL)
value = 0;
else
value = atoi(val_string);
! switch (VAR_TYPE) {
case V_STRING:
***************
*** 278,291 ****
}
break;
- case 3:
- if (!in_init) {
- msg("'%s' can only be set in the init file", variable);
- break;
- }
- BOOL_VAR = on;
- break;
-
case 4:
BOOL_VAR = !on;
break;
--- 302,307 ----
***************
*** 364,370 ****
so_printf("\1Variable settings:\1");
for (var = variables; var < &variables[TABLE_SIZE]; var++) {
! switch (var->var_type) {
case V_STRING:
str = (var->var_op == 1) ? CBUF_VAR : STR_VAR;
if (str == NULL || *str == NUL) break;
--- 380,386 ----
so_printf("\1Variable settings:\1");
for (var = variables; var < &variables[TABLE_SIZE]; var++) {
! switch (VAR_TYPE) {
case V_STRING:
str = (var->var_op == 1) ? CBUF_VAR : STR_VAR;
if (str == NULL || *str == NUL) break;
***************
*** 377,388 ****
if (pg_next() < 0) goto out;
b = BOOL_VAR;
if (var->var_op == 2 || var->var_op == 4) b = !b;
! printf("%s%s\n", b ? "" : "no", var->var_name);
break;
case V_INTEGER:
i = INT_VAR;
- if (i == 0) break;
if (pg_next() < 0) goto out;
printf("%-20.20s = %d\n", var->var_name, i);
break;
--- 393,403 ----
if (pg_next() < 0) goto out;
b = BOOL_VAR;
if (var->var_op == 2 || var->var_op == 4) b = !b;
! printf("%s%s\n", b ? "" : "no ", var->var_name);
break;
case V_INTEGER:
i = INT_VAR;
if (pg_next() < 0) goto out;
printf("%-20.20s = %d\n", var->var_name, i);
break;
***************
*** 417,423 ****
register struct variable_defs *var;
if ((var = lookup_variable(variable)) == NULL) return;
! if (var->var_type != V_BOOLEAN) {
init_message("variable %s is not boolean", variable);
return;
}
--- 432,438 ----
register struct variable_defs *var;
if ((var = lookup_variable(variable)) == NULL) return;
! if (VAR_TYPE != V_BOOLEAN) {
init_message("variable %s is not boolean", variable);
return;
}
***************
*** 444,450 ****
goto out;
}
! switch (var->var_type) {
case V_BOOLEAN:
res = BOOL_VAR;
--- 459,465 ----
goto out;
}
! switch (VAR_TYPE) {
case V_BOOLEAN:
res = BOOL_VAR;
*** /usr/storm/nn6.3.7/xmakefile Fri Sep 8 12:47:00 1989
--- xmakefile Tue Sep 12 09:55:12 1989
***************
*** 180,186 ****
rm -f prefix.c
cvt-help: cvt-help.c
! cc -o cvt-help cvt-help.c
active.o: active.c config.h global.h vararg.h data.h
admin.o: admin.c config.h global.h vararg.h data.h db.h term.h
--- 180,186 ----
rm -f prefix.c
cvt-help: cvt-help.c
! $(CC) -o cvt-help cvt-help.c
active.o: active.c config.h global.h vararg.h data.h
admin.o: admin.c config.h global.h vararg.h data.h db.h term.h